package com.itheima.health.service.impl;

import com.itheima.health.dao.UserRoleDao;
import com.itheima.health.pojo.UserRole;
import com.itheima.health.service.UserRoleService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Slf4j
@DubboService
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleDao userRoleDao;

    @Override
    public List<UserRole> findById(Integer id) {
        log.info("[user&role表-findById-接收值] - id: {}",id);
        UserRole newUserRole = new UserRole();
        newUserRole.setUserId(id);
        List<UserRole> userRoleList = userRoleDao.select(newUserRole);
        log.info("[user&role表-findById-返回值] - userRoleList: {}",userRoleList);
        return userRoleList;
    }
}
